package com.demo.controller;

import com.demo.domain.FctOtsorder;
import com.demo.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;

/**
 * Created by duanxifeng on 2017/5/25.
 */

@RestController
@EnableAutoConfiguration
@RequestMapping("/Order")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @ResponseBody
    @RequestMapping(value = "/getOrderByid",method = RequestMethod.GET)
    public FctOtsorder getOrderByid(@RequestParam("orderId") String orderId)
    {
        FctOtsorder fctOtsorder=orderService.getFctOtsOrderById(orderId);

        return  fctOtsorder;
    }


    @ResponseBody
    @RequestMapping(value = "/selectByPrimaryKey",method = RequestMethod.GET)
    public FctOtsorder selectByPrimaryKey(@RequestParam("orderId") String orderId)
    {
        Long id=Long.parseLong(orderId);
        FctOtsorder fctOtsorder=orderService.selectByPrimaryKey(id);

        return  fctOtsorder;
    }
}
